
def Flip(prob, rand):
    '''
    return True with a probability
    '''
    temp = rand.random()
    if temp <= prob:
        return True
    else:
        return False
